<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
const kNbsp = '\u00A0';

selection_test(
  [
    '<div contenteditable>',
      `<u>012 ^345</u><div><u>${kNbsp}678 |90A</u></div>`,
    '</div>',
  ],
  'underline',
  [
    '<div contenteditable>',
      `<u>012 </u>^345<div>${kNbsp}678 |<u>90A</u></div>`,
    '</div>',
  ],
  'Remove underline across paragrahp');

selection_test(
  [
    '<div contenteditable>',
      `<b><u>012 ^345</u></b><div><b><u>${kNbsp}678 |90A</u></b></div>`,
    '</div>',
  ],
  'underline',
  [
    '<div contenteditable>',
      `<b><u>012 </u>^345</b><div><b>${kNbsp}678 |<u>90A</u></b></div>`,
    '</div>',
  ],
  'Remove underline across paragrahp in bold');
</script>
